//
//  BaseViewController.m
//  ScalperMerchant
//
//  Created by 王云 on 2017/9/29.
//  Copyright © 2017年 WY. All rights reserved.
//

#import "BaseViewController.h"
#import "HWNotification.h"
#import "FirstViewController.h"
@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }
    self.view.backgroundColor = DarkColor;
    
    [self hw_registerNotification:[kUserDataLogOut UTF8String] block:^(NSNotification *notification) {
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [UIApplication sharedApplication].delegate.window.rootViewController =[[JTNavigationController alloc] initWithRootViewController:[[FirstViewController alloc] init]];
        });
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    [self.navigationController.navigationBar lt_setBackgroundColor:KOrange];
    
}
- (UIBarButtonItem *)rt_customBackItemWithTarget:(id)target action:(SEL)action{
    return [UIBarButtonItem itemWithIcon:@"navigationbar_back_highlighted"
                                highIcon:@"navigationbar_back_highlighted"
                                  target:self
                                  action:@selector(back)
            ];

}

- (void)back{
    
    [self.navigationController popViewControllerAnimated:YES];
    
}




@end
